package com.yanqu.road.server.cmd.activity.carptrip;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.CarpTripProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.carptrip.CarpTripActivity;
import com.yanqu.road.server.manager.activity.carptrip.CrossCarpTripActivityMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CARP_TRIP_GET_PVP_TOP, desc = "获取PVP数据")
public class CrossGetCarpTripPVPCellDataCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

        CarpTripProto.CrossGetCarpTripPVPCellDataReqMsg reqMsg = CarpTripProto.CrossGetCarpTripPVPCellDataReqMsg.parseFrom(packet.getBytes());
        CarpTripActivity activity = CrossCarpTripActivityMgr.getCarpTripActivity(reqMsg.getActivityId());
        if(activity != null){
            activity.getPVPData(serverId, packet.getPlayerId());
        }
    }

    @Override
    public void sendData() {

    }
}
